<h1>Sign Up</h1>

<%= form_for @user do |f| %>
  <% if @user.errors.any? %>
    <div class="error_messages">
      <h2>Form is invalid</h2>
      <ul>
        <% for message in @user.errors.full_messages %>
          <li><%= message %></li>
        <% end %>
      </ul>
    </div>
  <% end %>
  
  <p>
    <%= f.label :email %>p
    <%= f.text_field :email %><br />
  </p>
  <p>
    <%= f.label :gsm %>
    <%= f.text_field :gsm %>
  </p>  
  <p>
  	<%= f.label :city_id %>
  	<%= f.select :city_id, options_from_collection_for_select(City.find(:all, :order => :name), 'id', 'name', :selected => @user.city_id) %>
  <p>
    <%= f.label :password %>
    <%= f.password_field :password %>
  </p>
  <p>
    <%= f.label :password_confirmation %>
    <%= f.password_field :password_confirmation %>
  </p>
  <p class="button"><%= f.submit %></p>	
<% end %>